<!DOCTYPE html>
<html>
<head>
  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js" type="text/javascript" charset="utf-8"></script>

  <script src="../jquery.modal.js" type="text/javascript" charset="utf-8"></script>
  <link rel="stylesheet" href="../jquery.modal.css" type="text/css" media="screen" />

  <script src="highlight/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8"> hljs.initHighlightingOnLoad(); </script>
  <link rel="stylesheet" href="highlight/github.css" type="text/css" media="screen" />
  <link href='http://fonts.googleapis.com/css?family=Roboto:300,700' rel='stylesheet' type='text/css'>
  <style type="text/css" media="screen">
    html { background: #ddd; }
    body { font: normal 18px/1.6 'Open Sans', "Helvetica Neue", Arial, sans-serif; font-weight: 300; color: #777; padding: 2em 5%; width: 80%; max-width: 900px; margin: 0 auto; background: #fff; }
    small { color: #aaa; }
    h1,h2,h3,h4 { color: #444; font-weight: 700; font-size: 1.6em; letter-spacing: -1px; }
    a { color: #0086B3; font-weight: 700; }
    a:hover { color: #000; }
    p code, li code {background:#ffffcc; color: #444; }
    pre { font-size: 12px; line-height: 18px; }
    pre code { overflow: scroll; padding: 1em; border-radius: 10px; }
    hr { height: 10px; background: #eee; border: none; }
    table {width:100%;border-collapse:collapse;}
    td { border: 1px solid #eee; padding: 15px; }
    td pre { margin: 0; }

    /* Example 2 (login form) */
    .login_form.modal {
      border-radius: 0;
      line-height: 18px;
      padding: 0;
      font-family: "Lucida Grande", Verdana, sans-serif;
    }

    .login_form h3 {
      margin: 0;
      padding: 10px;
      color: #fff;
      font-size: 14px;
      background: -moz-linear-gradient(top, #2e5764, #1e3d47);
      background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #1e3d47),color-stop(1, #2e5764));
    }

    .login_form.modal p { padding: 20px 30px; border-bottom: 1px solid #ddd; margin: 0;
      background: -webkit-gradient(linear,left bottom,left top,color-stop(0, #eee),color-stop(1, #fff));
      overflow: hidden;
    }
    .login_form.modal p:last-child { border: none; }
    .login_form.modal p label { float: left; font-weight: bold; color: #333; font-size: 13px; width: 110px; line-height: 22px; }
    .login_form.modal p input[type="text"],
    .login_form.modal p input[type="password"] {
      font: normal 12px/18px "Lucida Grande", Verdana;
      padding: 3px;
      border: 1px solid #ddd;
      width: 200px;
    }


    .part {
      display: none;
    }

  </style>
  <title>jQuery Modal</title>
</head>
<body>

<h1>jQuery Modal</h1>
<p><em>the simplest modal you ever did see.</em> &ndash; <a href="http://github.com/kylefox/jquery-modal">Code on GitHub &raquo;</a></p>
<ul>
  <li>Automatic binding using HTML semantics</li>
  <li>No images &amp; light-weight <small>(about 1k minified)</small></li>
  <li>Simple markup makes it easy to style</li>
  <li>Attach custom behaviour using <a href="http://api.jquery.com/category/events/">jQuery events</a></li>
  <li>Close with click or ESC key</li>
  <li>Works in every single browser known to man (including Lynx)</li>
</ul>





<hr />

<h2>Example 1: Open &amp; Close with links</h2>
<ol>
  <li>Embed modal HTML in document <small>(and hide it)</small></li>
  <li>Create a link with <code>rel="modal:open"</code> and set the <code>href</code> attribute to the modal's DOM id.</li>
</ol>
<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;/style&gt;
  &lt;!-- Don't forget to include jQuery ;) --&gt;
  &lt;script src=&quot;jquery.modal.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

  &lt;!-- Modal HTML embedded directly into document --&gt;
  &lt;div id=&quot;ex1&quot; style=&quot;display:none;&quot;&gt;
    &lt;p&gt;Thanks for clicking.  That felt good.  &lt;a href=&quot;#&quot; rel=&quot;modal:close&quot;&gt;Close&lt;/a&gt; or press ESC&lt;/p&gt;
  &lt;/div&gt;

  &lt;!-- Link to open the modal --&gt;
  &lt;p&gt;&lt;a href=&quot;#ex1&quot; rel=&quot;modal:open&quot;&gt;Open Modal&lt;/a&gt;&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<!-- Link to open the modal -->
<p>Demo: <a href="#ex1" rel="modal:open">Open Modal</a></p>

<!-- Modal HTML embedded directly into document -->
<div class="modal" id="ex1" style="display:none;">
  <p>Thanks for clicking.  That felt good.  <br />Click <a href="#" rel="modal:close">close</a>, click the overlay, or press ESC</p>
</div>


<hr />

<h2>Example 2: styled login form &amp; events</h2>

<p>This <a href="#ex2" rel="modal:open">example</a> demonstrates how visually customizable the modal is.</p>

<!-- Modal HTML embedded directly into document -->
<form action="" class="login_form modal" id="ex2" style="display:none;">
  <h3>Please login to continue</h3>
  <p><label>Username:</label><input type="text" /></p>
  <p><label>Password:</label><input type="password" /></p>
  <p><input type="submit" value="Login" /></p>
</form>

<hr />

<h2>Example 3: resizing</h2>
<p>This <a href="#ex3" rel="modal:open">example</a> shows how <code>resize()</code> can be invoked on a modal.</p>
<div id="ex3" class="modal">
  <p><a id="more" href="#more">More!</a></p>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>

<hr />

<h2>Example 4: AJAX</h2>

<p>This <a href="ajax.html" rel="modal:open">first example</a> uses <code>rel="modal:open"</code> to automatically load the page contents into a modal via AJAX:</p>

<pre><code>&lt;a href=&quot;ajax.html&quot; rel=&quot;modal:open&quot;&gt;example&lt;/a&gt;</code></pre>

<p>This <a href="ajax2.html" id="manual-ajax">second example</a> shows how you can manually load AJAX pages into a modal. Note that the AJAX response must be wrapped in a div with class <code>modal</code>:</p>

<pre><code>&lt;!-- Normal link --&gt;<br/>&lt;a href=&quot;ajax.html&quot; id=&quot;manual-ajax&quot;&gt;second example&lt;/a&gt;</code></pre>

<pre><code>// Open modal in AJAX callback
$('#manual-ajax').click(function(event) {
  event.preventDefault();
  $.get(this.href, function(html) {
    $(html).appendTo('body').modal();
  });
});</code></pre>

<pre><code>&lt;!-- AJAX response must be wrapped in the modal's root class. --&gt;<br/>&lt;div class=&quot;modal&quot;&gt;<br/>  &lt;p&gt;Second AJAX Example!&lt;/p&gt;<br/>&lt;/div&gt;</pre></code>

<p>If you want more spinner styles, check out <a href="http://ajaxload.info/">ajaxload.info</a>.</p>

<hr />

<h2>Example 5: the un-closable window</h2>
<p>
  This <a href="#ex5">example</a> demonstrates how to disable the default methods of closing the modal:

<pre><code> $("#sticky").modal({
  escapeClose: false,
  clickClose: false,
  showClose: false
});</code></pre>


</p>
<div id="ex5" class="modal">
  <p>If you do this, be sure to provide the user with an alternate method of <a href="#" rel="modal:close">closing the window.</a></p>
</div>

<hr />

<h2>Example 6: Multiple Modals</h2>

<p>This <a href="#ex6-1" rel="modal:open">example</a> shows how only one modal can be open at a time. If you open a new modal while an existing modal is open, the existing modal is closed first. If you need to manage state (ie: for step by step wizards) you'll need to do that yourself.</p>

<div class="modal" id="ex6-1" style="display:none;">
  <p>I'm the first modal. <a href="#ex6-2" rel="modal:open">Open second modal...</a></p>
</div>

<div class="modal" id="ex6-2" style="display:none;">
  <p>I'm the second modal. <a href="#ex6-3" rel="modal:open">Open third modal...</a></p>
</div>

<div class="modal" id="ex6-3" style="display:none;">
  <p>I'm the third modal. You get the idea.</p>
</div>

<hr />

<h2>Example 7: Fade Transitions</h2>

<p>This <a href="#ex7">example</a> shows how you can do a simple fade by specifying the <code>fadeDuration</code> option.</p>

<pre><code> $("#fade").modal({
  fadeDuration: 100
});</code></pre>

<p>You can also use <code>fadeDelay</code> to control the point during the overlay's fade in at which the modal fades in. For <a href="#ex8">example</a>, to fade in the modal when the overlay transition is 50% complete:</p>

<pre><code> $("#fade").modal({
  fadeDuration: 1000,
  fadeDelay: 0.50
});</code></pre>

<p>The default value is <code>1.0</code>, meaning the window transition begins once the overlay transition has finished. Values greater than <code>1.0</code> mean there is a delay between the completed overlay transition and the start of the window transition, <a href="#ex9">example</a>:</p>

<pre><code> $("#fade").modal({
  fadeDuration: 1000,
  fadeDelay: 1.75 // Will fade in 750ms after the overlay finishes.
});</code></pre>

<p><small>Tip: set <code>fadeDelay: 0</code> to have the overlay and window fade in simultaneously.</small></p>

<p>In the spirit of keeping this library small, fading is the only supported transition. When the modal is closed, both the overal and window transition out simultaneously.</p>

<div id="ex7" class="modal">
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
  tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
  consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
  cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
  proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>

<div id="ex8" class="modal">
  <p>This modal starts fading in once the overlay is 50% faded in.</p>
</div>

<div id="ex9" class="modal">
  <p>This modal starts fading in well after the overlay has finished transitioning.</p>
</div>

<hr/>

<h2>Example 10: Custom Class for Close Button</h2>
<p>
  This <a href="#ex10">example</a> demonstrates how to add extra classes to the close button (for custom styles for the close button):
</p>

<pre><code> $("#custom-close").modal({
  closeClass: 'icon-remove',
  closeText: '!'
});</code></pre>
<p>And then of course your custom CSS</p>
<pre><code>.modal a.close-modal[class*="icon-"] {
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  color: #fff;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  text-indent: 0;
  background: #900;
  border: 2px solid #fff;
  -webkit-border-radius:  26px;
  -moz-border-radius:     26px;
  -o-border-radius:       26px;
  -ms-border-radius:      26px;
  -moz-box-shadow:    1px 1px 5px rgba(0,0,0,0.5);
  -webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
  box-shadow:         1px 1px 5px rgba(0,0,0,0.5);
}</code></pre>

<div id="ex10" class="modal">
  <p>This modal has a fancy-shmancy close button.</p>
</div>

<style type="text/css">
  .modal a.close-modal[class*="icon-"] {
    top: -10px;
    right: -10px;
    width: 20px;
    height: 20px;
    color: #fff;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    text-indent: 0;
    background: #900;
    border: 2px solid #fff;
    -webkit-border-radius: 26px;
    -moz-border-radius: 26px;
    -o-border-radius: 26px;
    -ms-border-radius: 26px;
    -moz-box-shadow:    1px 1px 5px rgba(0,0,0,0.5);
    -webkit-box-shadow: 1px 1px 5px rgba(0,0,0,0.5);
    box-shadow:         1px 1px 5px rgba(0,0,0,0.5);
  }
</style>

<script type="text/javascript" charset="utf-8">
  $(function() {

    function log_modal_event(event, modal) {
      if(typeof console != 'undefined' && console.log) console.log("[event] " + event.type);
    };

    $(document).on($.modal.BEFORE_BLOCK, log_modal_event);
    $(document).on($.modal.BLOCK, log_modal_event);
    $(document).on($.modal.BEFORE_OPEN, log_modal_event);
    $(document).on($.modal.OPEN, log_modal_event);
    $(document).on($.modal.BEFORE_CLOSE, log_modal_event);
    $(document).on($.modal.CLOSE, log_modal_event);
    $(document).on($.modal.AJAX_SEND, log_modal_event);
    $(document).on($.modal.AJAX_SUCCESS, log_modal_event);
    $(document).on($.modal.AJAX_COMPLETE, log_modal_event);

    $('#more').click(function() {
      $(this).parent().after($(this).parent().next().clone());
      $.modal.resize();
      return false;
    });

    $('#manual-ajax').click(function(event) {
      event.preventDefault();
      $.get(this.href, function(html) {
        $(html).appendTo('body').modal();
      });
    });

    $('a[href="#ex5"]').click(function(event) {
      event.preventDefault();
      $(this).modal({
        escapeClose: false,
        clickClose: false,
        showClose: false
      });
    });

    $('a[href="#ex7"]').click(function(event) {
      event.preventDefault();
      $(this).modal({
        fadeDuration: 250
      });
    });

    $('a[href="#ex8"]').click(function(event) {
      event.preventDefault();
      $(this).modal({
        fadeDuration: 1000,
        fadeDelay: 0.50
      });
    });

    $('a[href="#ex9"]').click(function(event) {
      event.preventDefault();
      $(this).modal({
        fadeDuration: 1000,
        fadeDelay: 1.75
      });
    });

    $('a[href="#ex10"]').click(function(event){
      event.preventDefault();
      $(this).modal({
        closeClass: 'icon-remove',
        closeText: '!'
      });
    });

  });
</script>
</body>
</html>
